import javafx.scene.control.Label;

public class ScoreBoard {
    private int score;
    private Label scoreLabel;
    public ScoreBoard() {
        this.score = 0;
    }
    public void addScore(int points) {
        score += points;
        updateScoreLabel();
    }
    public void reset() {
        score = 0;
        updateScoreLabel();
    }
    public int getScore() {
        return score;
    }
    public void setScoreLabel(Label scoreLabel) {
        this.scoreLabel = scoreLabel;
        updateScoreLabel();
    }
    private void updateScoreLabel() {
        if (scoreLabel != null) {
            scoreLabel.setText("" + score);
        }
    }
}
